#include "People.h"

int People::counter = 0;
People::People(char* name, Date birthday, int id)
{
	setId(id);
	setName(name);
	setBirthday(birthday);
	++counter;
}

void People::PrintInfo()
{
	cout << "Id: " << id << endl;
	cout << "Name: " << name << endl;
	cout << "Birthday: ";
	birthday.display();

}

void People::PrintInfo(ostream &out)
{
	out << "Id: " << id << endl;
	out << "Name: " << name << endl;
	out << "Birthday: ";
	birthday.display(out);

}
char* People::getName(){return name;}
Date People::getBirthday(){return birthday;}
int People::getId(){return id;}
void People::setName(char* name)
{
	this->name = new char[strlen(name)+1];
	strcpy(this->name, name);
}
void People::setBirthday(Date dob)
{
	this->birthday = dob;
}
void People::setId(int id)
{
	this->id = id;
}
People::~People()
{
	//cout << "Deallocated. Counter = " << --counter << endl;
}